import React , {useState} from 'react'
import copy from 'copy-to-clipboard';
import {QRCodeSVG} from 'qrcode.react';
function Homeson() {
  let fn = ()=>{
    copy(val)
  }
  let [val,setVal] = useState("dadasdasd")
  return (
    <>
          {/* value 代表着扫这个二维码跳转的链接 */}
          <QRCodeSVG value="https://gitee.com/zhaozhihao19960521/react2007b"  size={333}  imageSettings={{
              src:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202111%2F10%2F20211110082815_526b2.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1674629731&t=3ba0867ef933e1ae7d6ea6371a739b2c",
              width:50,
              height:50
            }
          }/>
          <div>{val}</div>
          <button onClick={fn}> 点击复制</button>
    </>
  

  )
}

export default Homeson